<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
    <meta name="referrer" content="origin">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta name="keywords" content="liujit.com"/>
    <meta name="description" content="刘军的个人博客"/>
    <title>(◍´꒳`◍) Hi</title>

    <div th:replace="~{common/commonJs :: topSource}"></div>
    <link type="text/css" rel="stylesheet"
          href="https://cdn.jsdelivr.net/gh/liujun0128/blog@master/static/css/index.css"/>

</head>

<style>
    /* font-family: 'Courier New', Courier, monospace; */
</style>
<body>
<div th:replace="common/navTool :: navTools"></div>
<a id="cover"></a>

<div id="header">
    <div class="header">
        <div class="vertical">
            <div class="inner">
                <h1 class="header-title">Hello World</h1>
                <h2 class="header-description" id="hitokoto"></h2>
                <h3 class="header-info" id="hitokotoAuthor"></h3>
            </div>
        </div>
        <a class="scroll-down" href="javascript:;" target="_self" data-offset="-45">
            <span class="hidden">Scroll Down</span>
            <i class="scroll-down-icon iconfont icon-return"></i>
        </a>
    </div>
</div>

<div id="container">
    <div id="content">
        <!-- 文章 -->
        <div class="articles">
            <div class="article" th:each="info : ${articleList}">
                <div class="article-title">
                    <a th:href="'/blog/article/'+${info.id}" th:text="${info.title}">文章标题</a>
                    <span th:if="${info.isTop==1}" class="article-sticky">置顶</span>
                </div>
                <div class="article-abstract">
                    <span th:text="${'摘要：'+#strings.substring(info.content,0,150)}"></span>
                    <a th:href="'/blog/article/'+${info.id}" style="display: inline-block">阅读全文</a>
                </div>
                <div class="clear"></div>
                <div class="article-info">
                <span>
                  <i class="iconfont icon-time"></i>
                    <span th:text="'发表时间：'+${#dates.format(info.updateTime, 'yyyy-MM-dd HH:mm')}"></span>
                </span>
                    <span id="/路径" class="leancloud_visitors" data-flag-title="标题">
                        <i class="iconfont icon-browse"></i>
                        <span th:text="'阅读：'+${info.readNum}">0</span>
                    </span>
                    <span>
                      <i class="iconfont icon-interactive"></i>
                        <span th:text="'评论：'+${info.commentNum}">0</span>
                    </span>
                </div>

                <div class="clear"></div>
            </div>
            <!-- 分页 -->
            <div th:replace="common/paging :: paging"></div>
        </div>

    </div>
</div>

<div id="footer"></div>
<div th:replace="common/menu :: menu"></div>


<script th:replace="~{common/commonJs :: config}"></script>
<script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
<script type="text/javascript">

    let headerTextList = [
        '每一个不曾起舞的日子，都是对生命的辜负。',
        '公主死去了，屠龙的少年还在燃烧',
        '我们听过无数的道理，却仍旧过不好这一生。',
        '生如夏花之绚烂，死如秋叶之静美。',
        '但凡不能杀死你的，最终都会使你更强大。',
        '好看的皮囊千篇一律，有趣的灵魂万里挑一。',
        '青春是一本太仓促的书，我们含着泪，一读再读。',
        '教育就是当一个人把在学校所学全部忘光之后剩下的东西。',
        '孤独不是一种脾性，而是一种无奈。',
        '有时候你以为天要塌下来了，其实是自己站歪了。',
        '温柔正确的人总是难以生存，因为这世界既不温柔，也不正确。',
        '死并非生的对立面，而作为生的一部分永存。',
        '不要努力成为一个成功者，要努力成为一个有价值的人。',
        '不要因为走得太远，忘了我们为什么出发。',
        '你的问题主要在于读书不多而想得太多。',
        '岁月不饶人，我亦未曾饶过岁月。',
        '当你凝视深渊时，深渊也在凝视着你。',
        '有的人25岁就死了，只是到75岁才埋葬。'
    ];

    function randomNum(minNum, maxNum) {
        switch (arguments.length) {
            case 1:
                return parseInt(Math.random() * minNum + 1);
                break;
            case 2:
                return parseInt(Math.random() * (maxNum - minNum + 1) + minNum);
                break;
            default:
                return 0;
                break;
        }
    };

    jinrishici.load(function (response) {
        if (response && response.status === "success") {
            $('#hitokoto').text(response.data.content).show();
            $('#hitokotoAuthor').text('《' + response.data.origin.title + '》 - ' + response.data.origin.dynasty + ' - ' + response.data.origin.author).show();
        } else {
            let listIndex = randomNum(0, headerTextList.length - 1);
            $('#hitokoto').text(headerTextList[listIndex]).show();
        }
        $('#container').css('margin-top', $('.header').outerHeight() + 'px');
    });
</script>
</body>

</html>